<div class="panel panel-default panel-intro">

    <div class="panel-body">
        <div id="myTabContent" class="tab-content">
            <div class="tab-pane fade active in" id="one">
                <div class="widget-body no-padding">

                    <div class="row">
                        <div class="table-responsive" style="padding: 0px 20px">
                            <table id="table" class="table table-striped table-bordered table-hover table-nowrap">
                                <thead>
                                <th>{:__('预览')}</th>
                                <th>{:__('文件名')}</th>
                                <th>{:__('文件类型')}</th>
                                </thead>
                                <tbody>
                                {php}
                                $files_list=$row->files;
                                $cdnurl = preg_replace("/\/(\w+)\.php$/i", '', request()->root());
                                foreach ($files_list as $k => &$row) {
                                    $row['fullurl'] = cdnurl($row['url']);
                                    $row['imagetype'] =pathinfo($row['url'], PATHINFO_EXTENSION);
                                }
                                {/php}
                                {foreach name="files_list" item="v"  index="i" }
                                <tr>
                                    <td>
                                        {if(preg_match('/.*(\.png|\.jpg|\.jpeg|\.gif)$/', $v.fullurl)) }
                                        <a href="{$v.fullurl}" target="_blank"><img src="{$v.fullurl}" alt="" style="max-height:90px;max-width:120px"></a>
                                        {else/}
                                        <a href="{$v.fullurl}" target="_blank"><img src="{:url('ajax/icon')}?suffix={$v.imagetype}" alt="" style="max-height:90px;max-width:120px"></a>
                                        {/if}
                                    </td>
                                    <td></td>

                                    <td>
                                        {$v.imagetype}
                                    </td>


                                </tr>
                                {/foreach}
                                </tbody>
                            </table>
                        </div>
                    </div>


                </div>
            </div>

        </div>
    </div>
</div>
